<%@ page import="org.model.SugarCase" %>



<div class="fieldcontain ${hasErrors(bean: sugarCaseInstance, field: 'description', 'error')} ">
	<label for="description">
		<g:message code="sugarCase.description.label" default="Description" />
		
	</label>
	<g:textArea name="description" cols="40" rows="5" maxlength="15000" value="${sugarCaseInstance?.description}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: sugarCaseInstance, field: 'sugarStatus', 'error')} ">
	<label for="sugarStatus">
		<g:message code="sugarCase.sugarStatus.label" default="Sugar Status" />
		
	</label>
	<g:textField name="sugarStatus" value="${sugarCaseInstance?.sugarStatus}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: sugarCaseInstance, field: 'guid', 'error')} ">
	<label for="guid">
		<g:message code="sugarCase.guid.label" default="Guid" />
		
	</label>
	<g:textField name="guid" value="${sugarCaseInstance?.guid}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: sugarCaseInstance, field: 'sugarCaseNumber', 'error')} ">
	<label for="sugarCaseNumber">
		<g:message code="sugarCase.sugarCaseNumber.label" default="Sugar Case Number" />
		
	</label>
	<g:textField name="sugarCaseNumber" value="${sugarCaseInstance?.sugarCaseNumber}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: sugarCaseInstance, field: 'name', 'error')} ">
	<label for="name">
		<g:message code="sugarCase.name.label" default="Name" />
		
	</label>
	<g:textArea name="name" cols="40" rows="5" maxlength="1000" value="${sugarCaseInstance?.name}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: sugarCaseInstance, field: 'sugarDateCreated', 'error')} ">
	<label for="sugarDateCreated">
		<g:message code="sugarCase.sugarDateCreated.label" default="Sugar Date Created" />
		
	</label>
	<g:textField name="sugarDateCreated" value="${sugarCaseInstance?.sugarDateCreated}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: sugarCaseInstance, field: 'type', 'error')} ">
	<label for="type">
		<g:message code="sugarCase.type.label" default="Type" />
		
	</label>
	<g:select id="type" name="type.id" from="${org.model.Type.list()}" optionKey="id" value="${sugarCaseInstance?.type?.id}" class="many-to-one" noSelection="['null': '']"/>
</div>

<div class="fieldcontain ${hasErrors(bean: sugarCaseInstance, field: 'sugarAssignedTo', 'error')} ">
	<label for="sugarAssignedTo">
		<g:message code="sugarCase.sugarAssignedTo.label" default="Sugar Assigned To" />
		
	</label>
	<g:textField name="sugarAssignedTo" value="${sugarCaseInstance?.sugarAssignedTo}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: sugarCaseInstance, field: 'accountGuid', 'error')} ">
	<label for="accountGuid">
		<g:message code="sugarCase.accountGuid.label" default="Account Guid" />
		
	</label>
	<g:textField name="accountGuid" value="${sugarCaseInstance?.accountGuid}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: sugarCaseInstance, field: 'accountName', 'error')} ">
	<label for="accountName">
		<g:message code="sugarCase.accountName.label" default="Account Name" />
		
	</label>
	<g:textField name="accountName" maxlength="155" value="${sugarCaseInstance?.accountName}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: sugarCaseInstance, field: 'devTime', 'error')} ">
	<label for="devTime">
		<g:message code="sugarCase.devTime.label" default="Dev Time" />
		
	</label>
	<g:select name="devTime" from="${0..500}" class="range" value="${fieldValue(bean: sugarCaseInstance, field: 'devTime')}" noSelection="['': '']"/>
</div>

<div class="fieldcontain ${hasErrors(bean: sugarCaseInstance, field: 'projectStatus', 'error')} ">
	<label for="projectStatus">
		<g:message code="sugarCase.projectStatus.label" default="Project Status" />
		
	</label>
	<g:select id="projectStatus" name="projectStatus.id" from="${org.model.ProjectStatus.list()}" optionKey="id" value="${sugarCaseInstance?.projectStatus?.id}" class="many-to-one" noSelection="['null': '']"/>
</div>

<div class="fieldcontain ${hasErrors(bean: sugarCaseInstance, field: 'fixStatus', 'error')} ">
	<label for="fixStatus">
		<g:message code="sugarCase.fixStatus.label" default="Fix Status" />
		
	</label>
	<g:select id="fixStatus" name="fixStatus.id" from="${org.model.FixStatus.list()}" optionKey="id" value="${sugarCaseInstance?.fixStatus?.id}" class="many-to-one" noSelection="['null': '']"/>
</div>

<div class="fieldcontain ${hasErrors(bean: sugarCaseInstance, field: 'sugarDateMod', 'error')} ">
	<label for="sugarDateMod">
		<g:message code="sugarCase.sugarDateMod.label" default="Sugar Date Mod" />
		
	</label>
	<g:textField name="sugarDateMod" value="${sugarCaseInstance?.sugarDateMod}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: sugarCaseInstance, field: 'costs', 'error')} ">
	<label for="costs">
		<g:message code="sugarCase.costs.label" default="Costs" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${sugarCaseInstance?.costs?}" var="c">
    <li><g:link controller="cost" action="show" id="${c.id}">${c?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="cost" action="create" params="['sugarCase.id': sugarCaseInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'cost.label', default: 'Cost')])}</g:link>
</li>
</ul>

</div>

<div class="fieldcontain ${hasErrors(bean: sugarCaseInstance, field: 'fixes', 'error')} ">
	<label for="fixes">
		<g:message code="sugarCase.fixes.label" default="Fixes" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${sugarCaseInstance?.fixes?}" var="f">
    <li><g:link controller="projectFix" action="show" id="${f.id}">${f?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="projectFix" action="create" params="['sugarCase.id': sugarCaseInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'projectFix.label', default: 'ProjectFix')])}</g:link>
</li>
</ul>

</div>

<div class="fieldcontain ${hasErrors(bean: sugarCaseInstance, field: 'ignoreUpdate', 'error')} ">
	<label for="ignoreUpdate">
		<g:message code="sugarCase.ignoreUpdate.label" default="Ignore Update" />
		
	</label>
	<g:checkBox name="ignoreUpdate" value="${sugarCaseInstance?.ignoreUpdate}" />
</div>

<div class="fieldcontain ${hasErrors(bean: sugarCaseInstance, field: 'tags', 'error')} ">
	<label for="tags">
		<g:message code="sugarCase.tags.label" default="Tags" />
		
	</label>
	<g:select name="tags" from="${org.model.Tag.list()}" multiple="multiple" optionKey="id" size="5" value="${sugarCaseInstance?.tags*.id}" class="many-to-many"/>
</div>

<div class="fieldcontain ${hasErrors(bean: sugarCaseInstance, field: 'updateElements', 'error')} ">
	<label for="updateElements">
		<g:message code="sugarCase.updateElements.label" default="Update Elements" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${sugarCaseInstance?.updateElements?}" var="u">
    <li><g:link controller="updateElements" action="show" id="${u.id}">${u?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="updateElements" action="create" params="['sugarCase.id': sugarCaseInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'updateElements.label', default: 'UpdateElements')])}</g:link>
</li>
</ul>

</div>

